package com.sense.kukoo.biz_media.model

import com.sense.kukoo.biz_media.net.MediaHttpApi
import com.sense.kukoo.common.mvvm.model.BaseMvvmModel
import com.sense.kukoo.common.repo.bean.ResultBean
import com.sense.kukoo.common.repo.http.KukooHttpApi
import com.sense.kukoo.common.repo.http.KukooHttpManager

class MediaControlerModel: BaseMvvmModel() {

    private val TAG: String = javaClass.simpleName

    override fun onModelCleared() {}

    suspend fun isSubscription(contentUserId: Long): ResultBean<Boolean> {
        return KukooHttpManager.instance
            .createHttpClient(KukooHttpApi::class.java)
            .isSubscription("${contentUserId}")
    }

    suspend fun subscription(contentUserId: Long): ResultBean<Boolean> {
        return KukooHttpManager.instance
            .createHttpClient(KukooHttpApi::class.java)
            .subscription("${contentUserId}")
    }

    suspend fun isLike(contentId: Long): ResultBean<Boolean> {
        return KukooHttpManager.instance
            .createHttpClient(KukooHttpApi::class.java)
            .isLike("${contentId}")
    }

    suspend fun like(contentId: Long, contentUserId: Long): ResultBean<Boolean> {
        return KukooHttpManager.instance
            .createHttpClient(KukooHttpApi::class.java)
            .like("${contentId}", "${contentUserId}")
    }
}